package cn.cdeden.knowledge.domain;

import cn.cdeden.knowledge.domain.dto.CommonModel;
import cn.cdeden.knowledge.service.dto.SysPortalImagesDto;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import com.baomidou.mybatisplus.annotation.*;
import io.github.linpeilie.annotations.AutoMapper;
import io.github.linpeilie.annotations.AutoMappers;
import lombok.*;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.util.Date;

/**
* @author gjx
* @date 2024-09-26
*/
@Data
@Builder
@Accessors(chain = true)
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode(callSuper = false)
@TableName("sys_portal_images")
@AutoMappers({@AutoMapper(target = SysPortalImagesDto.class)})
public class SysPortalImages extends CommonModel<SysPortalImages> implements Serializable {
    private static final long serialVersionUID = 1L;

//    @ApiModelProperty(value = "主键ID")
    @TableId(type= IdType.AUTO)
    private Long id;

//    @ApiModelProperty(value = "名称")
    private String name;

//    @ApiModelProperty(value = "图片地址")
    private String url;

//    @ApiModelProperty(value = "创建时间")
    @TableField(fill= FieldFill.INSERT)
    private Date createTime;

//    @ApiModelProperty(value = "文件存储ID")
    private Long storageId;


    private String module;

    private String libraryId;

    private Long size;

    private String suffix;

    public void copyFrom(SysPortalImages source){
        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
    }
}
